textview: Only trigger drag gesture on GDK_BUTTON_PRIMARY
authorCarlos Garnacho <carlosg@gnome.org>
Sat, 31 May 2014 12:54:32 +0000 (14:54 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 31 May 2014 13:11:05 +0000 (15:11 +0200)
This gesture was only meant to react on GDK_BUTTON_PRIMARY (either
through real pointer events, or implicitly assumed from touch events),
as it used to behave before gestures. Otherwise the gtk_drag_begin*()
call assumes being triggered by button 1, and the drag misbehaves
because that button isn't really in the state mask.

https://bugzilla.gnome.org/show_bug.cgi?id=731016

gtk/gtktextview.c

index a66e5f2a2d151b84603edd352db12ef2545bc649..f06665e0896f48693305cd5801c31b1c7d7f138e 100644 (file)
@@ -1564,6 +1564,8 @@ gtk_text_view_init (GtkTextView *text_view)
   priv->drag_gesture = gtk_gesture_drag_new (widget);
   gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->drag_gesture),
                                      FALSE);
+  gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->drag_gesture),
+                                 GDK_BUTTON_PRIMARY);
   gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->drag_gesture),
                                               GTK_PHASE_BUBBLE);
   g_signal_connect (priv->drag_gesture, "drag-update",